from common.base import Base, By, get_driver
import time

class RegisterPage(Base):
    register_url = 'http://localhost:8080/ecshop/user.php?act=register'

    def username_input(self,username):
        self.send_keys((By.ID,'username'),username)

    def email_input(self,email):
        self.send_keys((By.ID,'email'),email)

    def password_input(self,password):
        self.send_keys((By.ID,'password1'),password)

    def confirm_password_input(self,confirm_password):
        self.send_keys((By.ID,'conform_password'),confirm_password)

    def phonenumber_input(self,phonenumber):
        self.send_keys((By.XPATH,'/html/body/div[6]/div/form/table/tbody/tr[9]/td[2]/input'),phonenumber)

    def submit_btn(self):
        self.click((By.XPATH,'/html/body/div[6]/div/form/table/tbody/tr[15]/td[2]/input[3]'))

    def page_quit(self):
        self.quit()